FROM node:9.2-alpine as builder
RUN apk add --no-cache git python make openssl
ADD yapi.zip /yapi.zip
RUN mkdir /api && \
    unzip yapi.zip && \
    rm -f yapi.zip && \
    mv yapi* /api/vendors
RUN cd /api/vendors && \
    npm install --production --registry https://registry.npm.taobao.org
FROM node:9.2-alpine
MAINTAINER yurui@xxxx.com
ENV TZ="Asia/Shanghai" HOME="/"
WORKDIR ${HOME}
COPY --from=builder /api/vendors /api/vendors
COPY config.json /api/
EXPOSE 3000
ENTRYPOINT ["node"]